package com.mlethe.library.recyclerview.listener;

import androidx.annotation.NonNull;

import com.mlethe.library.recyclerview.viewholder.ViewHolder;

/**
 * 拖拽监听
 *
 * @author Mlethe
 * @date 2020/9/24
 */
public interface OnItemDragListener<T> {
    /**
     * 拖拽开始
     *
     * @param viewHolder
     * @param item
     * @param position
     */
    void onItemDragStart(@NonNull ViewHolder viewHolder, T item, int position);

    /**
     * 拖拽进行中
     *
     * @param source
     * @param fromPosition
     * @param target
     * @param toPosition
     * @param item
     */
    void onItemDragMoving(@NonNull ViewHolder source, int fromPosition, @NonNull ViewHolder target, int toPosition, T item);

    /**
     * 拖拽结束
     *
     * @param viewHolder
     * @param item
     * @param position
     */
    void onItemDragEnd(@NonNull ViewHolder viewHolder, T item, int position);
}
